<template>
  <div class="clearfix WH100">
    <pc-header @iconChange="iconChange"></pc-header>
    <pc-menu :is-collapse="isCollapse" :menu-data="menuData"></pc-menu>
    <router-view
      key="$route.fullPath"
      class="main-con clearfix"
      :class="{ small: isCollapse }"
    ></router-view>
  </div>
</template>

<script>
import axios from "axios";
import pcHeader from "@/components/PcHeader.vue";
import pcMenu from "@/components/PcMenu.vue";

export default {
  components: {
    pcHeader,
    pcMenu,
  },
  data() {
    return {
      userInfo: JSON.parse(localStorage.getItem("userInfo")),
      url: "",
      exclude: {},
      isCollapse: true,
      menuData: [],
    };
  },
  methods: {
    iconChange(e) {
      this.isCollapse = e;
    },
  },
  inject: ["imageUrl", "serviceUrl"],
  async mounted() {
    this.menuData = JSON.parse(localStorage.getItem('menuData'))
    console.log(this.menuData,'this.menuData');
  },
};
</script>
<style lang="less">
body {
  background: #eeeeee;
  width: 100%;
  height: 100%;
}
.main-con {
  left: 260px;
  position: fixed;
  right: 10px;
  top: 70px;
  bottom: 10px;
  overflow: auto;
  background: #fff;
  &.small {
    left: 95px;
  }
}
</style>
